/*
* getTableData
* 表格请求
* */
function getTableData(nurseid, type, add, callback) {
    $.ajax({
        url: "http://60.164.210.223:7577/Nvr/map/getNurseGjzLc",
        dataType: "jsonp",
        data: {
            nurseId: nurseid,
            gjzType: type,
            address: add === "所有村落" ? "" : add
        },
        type: 'POST',
        beforeSend: function () {
            placeholder.show(document.body);
        },
        success: function (item) {
            callback(item);
        },
        error: function (error) {
            alert("表格请求失败！");
            placeholder.hide(document.body);
            $(".vii-holder-mask").hide();
        }
    });
}


/*
 * getDefaultValue
 * 获取默认配置项的值
 * */
function getDefaultValue() {
    return {
        getLc: "",
        nurseId: $("#coverTableSelect").val(),
        gjzType: $("#coverTableType").val(),
        address: $("#coverTablevillage").val(),
        manageNurse: "",
        sex: "",
        age: '18,56',
        pulpAge: '0,38',
        currentTimePulp: '0,27',
        lastTimePulps: '0,27',
        lastYearPulps: '0,27',
        times: '0,963'
    };
}

/*
   * getNurseList
   * 生成村落列
  * */

getNurseList(function (item) {
    placeholder.show(document.body);
    var nurseHtml = "<option value=''>所有护士</option>";
    for (var nur = 0; nur < item.length; nur++) {
        nurseHtml += "<option value='" + item[nur].nurseId + "'>" + item[nur].nurseName + "【" + item[nur].allProviderNum + "人】</option>";
    }
    $("#coverTableSelect").html(nurseHtml);
    $("#coverTableSelect").val("mxz26");
    $("#coverTableType").val("0");

    //初始化浆员类型下拉框
    getNurseTypePeople("mxz26", function (item) {
        var items = item.ngc;
        var items1 = item.wxj[0];
        var html = '<option value="0">所有浆员</option>' +
            '<option value="8">A：今年已进站浆员【' + items.currentTimePNum + '人】</option>' +
            '<option value="1">A1：忠诚浆员【' + items.currentTimeZCPNum + '人】</option>' +
            '<option value="2">A2：复苏浆员【' + items.currentTimeFuSuPNum + '人】</option>' +
            '<option value="3">A3：今年新浆员【' + items.currentTimeAddPNum + '人】</option>' +
            '<option value="7">A4：未被链接浆员【' + items.comedNotConnPNum + '人】</option>' +
            '<option value="9">B：今年未进站浆员【' + items.currentTimeNotComedPNum + '人】</option>' +
            '<option value="4">B1：休眠浆员【' + items.xiuMianPNum + '人】</option>' +
            '<option value="5">B2：流失浆员【' + items.liuShiPNum + '人】</option>' +
            '<option value="6">B1.1：已链接的休眠浆员【' + items.connXMPNum + '人】</option>' +
            '<option value="10">B1.2：未链接的休眠浆员【' + items.notConnXMPNum + '人】</option>' +
            '<option value="11">R浆员【' + items1.rtypeNum + '人】</option>' +
            '<option value="12">建档未献浆浆员【' + items1.notPulpNum + '人】</option>' +
            '<option value="13">五步链接浆员【' + items1.fiveLinkNum + '人】</option>';
        $("#coverTableType").html(html);
        //初始化下拉选框值
        getNurseTypeVillage("mxz26", "0", function (items) {
            if (items) {
                var addHtml = "<option value='所有村落'>所有村落【" + items.length + "个村】</option>";
                for (var add = 0; add < items.length; add++) {
                    addHtml += "<option value='" + (items[add].substr(0, items[add].indexOf("【"))) + "'>" + (add + 1) + "：" + items[add] + "</option>";
                }
                $("#coverTablevillage").html(addHtml);
            } else {
                $("#coverTablevillage").html("<option value='所有村落'>所有村落【0个村】</option>");
            }
            //初始化轮次表
            getTableData($("#coverTableSelect").val(), $("#coverTableType").val(), $("#coverTablevillage").val(), function (item) {
                initTable(getDefaultValue(), item);
            });
        });
    });


});


/*
  * coverTableSelect
  * 切换护士触发的事件
  * */
$("#coverTableSelect").on("change", function () {
    // 获取村子信息
    getNurseTypeVillage($(this).val(), $("#coverTableType").val(), function (items) {
        if (items) {
            var addHtml = "<option value='所有村落'>所有村落【" + items.length + "个村】</option>";
            for (var add = 0; add < items.length; add++) {
                addHtml += "<option value='" + (items[add].substr(0, items[add].indexOf("【"))) + "'>" + (add + 1) + "：" + items[add] + "</option>";
            }
            $("#coverTablevillage").html(addHtml);
        } else {
            $("#coverTablevillage").html("<option value='所有村落'>所有村落【0个村】</option>");
        }

    });
    //获取浆员类型信息
    getNurseTypePeople($(this).val(), function (item) {

        var items = item.ngc;
        var items1 = item.wxj[0];
        var html = '<option value="0">所有浆员</option>' +
            '<option value="8">A：今年已进站浆员【' + items.currentTimePNum + '人】</option>' +
            '<option value="1">A1：忠诚浆员【' + items.currentTimeZCPNum + '人】</option>' +
            '<option value="2">A2：复苏浆员【' + items.currentTimeFuSuPNum + '人】</option>' +
            '<option value="3">A3：今年新浆员【' + items.currentTimeAddPNum + '人】</option>' +
            '<option value="7">A4：未被链接浆员【' + items.comedNotConnPNum + '人】</option>' +
            '<option value="9">B：今年未进站浆员【' + items.currentTimeNotComedPNum + '人】</option>' +
            '<option value="4">B1：休眠浆员【' + items.xiuMianPNum + '人】</option>' +
            '<option value="5">B2：流失浆员【' + items.liuShiPNum + '人】</option>' +
            '<option value="6">B1.1：已链接的休眠浆员【' + items.connXMPNum + '人】</option>' +
            '<option value="10">B1.2：未链接的休眠浆员【' + items.notConnXMPNum + '人】</option>' +
            '<option value="11">R浆员【' + items1.rtypeNum + '人】</option>' +
            '<option value="12">建档未献浆浆员【' + items1.notPulpNum + '人】</option>' +
            '<option value="13">五步链接浆员【' + items1.fiveLinkNum + '人】</option>';
        $("#coverTableType").html(html);
    })
});


/*
* coverTableType
* 切换类型触发的事件
* */
$("#coverTableType").on("change", function () {
    //获取村子信息x
    getNurseTypeVillage($("#coverTableSelect").val(), $(this).val(), function (items) {
        if (items) {
            var addHtml = "<option value='所有村落'>所有村落【" + items.length + "个村】</option>";
            for (var add = 0; add < items.length; add++) {
                addHtml += "<option value='" + (items[add].substr(0, items[add].indexOf("【"))) + "'>" + (add + 1) + "：" + items[add] + "</option>";
            }
            $("#coverTablevillage").html(addHtml);
        } else {
            $("#coverTablevillage").html("<option value='所有村落'>所有村落【0个村】</option>");
        }
    });
});


/*
  * query1
  * 查询数据
  * */
$("#query1").on("click", function () {
    getTableData($("#coverTableSelect").val(), $("#coverTableType").val(), $("#coverTablevillage").val(), function (item) {
        initTable(getDefaultValue(), item);
    });
});


/*
   * initTable
   * 生成轮次表
   * */
function initTable(value, roundTable) {
    var typeText = $("#coverTableType").find("option:selected").text();
    var nurseText = $("#coverTableSelect").find("option:selected").text();
    var nurse = nurseText === "所有护士" ? nurseText : nurseText.substring(0, nurseText.indexOf("【"));
    var type = typeText === "所有浆员" ? typeText : typeText.substring(typeText.indexOf("：") + 1, typeText.indexOf("【"));
    var village = $("#coverTablevillage").val();
    var sex = value.sex === "" ? "" : ( value.sex === "1" ? " -- 男" : " -- 女" );
    var manageNurse = value.manageNurse === "" ? "" : ( value.manageNurse === "1" ? " -- 已链接" : " -- 未链接" );
    var age = value.age !== "18,56" ? " -- [" + value.age + "]岁" : "";
    var pulpAge = value.pulpAge !== "0,38" ? " -- [" + value.pulpAge + "]年浆龄" : "";
    var currentTimePulp = value.currentTimePulp !== "0,27" ? " -- 今年总次数[" + value.currentTimePulp + "]次" : "";
    var lastTimePulps = value.lastTimePulps !== "0,27" ? " -- 去年同期总次数[" + value.lastTimePulps + "]次" : "";
    var lastYearPulps = value.lastYearPulps !== "0,27" ? " -- 去年总次数[" + value.lastYearPulps + "]次" : "";
    var times = value.times !== "0,963" ? " -- 献浆总次数[" + value.times + "]次" : "";

    $("#coverTable> .show-title h1").html(
        nurse + " -- " +
        type + " -- " +
        village +
        sex + manageNurse + age + pulpAge + currentTimePulp + lastTimePulps + lastYearPulps + times + "：" +
        "<span style='font-size: 1.8rem;font-weight: bold;'>" + roundTable.jylc.length + "人" + "</span>"
    );
    var bodyclientH = document.body.clientHeight;
    //top table
    $("#thisTown").bootstrapTable('destroy').bootstrapTable({
        cache: false,
        data: (function () {
            var ngcl = roundTable.ngcl;
            var data = [];
            if ($("#coverTablevillage").val() !== "所有村落") {
                ngcl.unshift(roundTable.ngc);
                return ngcl;
            } else {
                data.unshift(roundTable.ngc);
                return data;
            }
        }()),
        undefinedText: "",
        columns: [
            {
                title: '链接浆员总人数',
                width: "2.75%",
                class: "c_000 bg_d1c",
                field: "connedPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: '去年浆量/袋',
                field: "lastYearCollNum",
                class: "c_000 bg_f3d",
                width: "2.75%",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: '当期进站人数',
                field: 'currentTimePNum',
                width: "2.75%",
                class: "c_000 bg_f3d",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: '同期进站人数',
                field: "lastTimePNum",
                class: "c_000 bg_f3d",
                width: "2.75%",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: '当期浆量/袋',
                field: 'currentTimeCollNum',
                class: "c_000 bg_f3d",
                width: "2.75%",
                align: "center",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: '同期浆量/袋',
                field: 'lastTimeCollNum',
                class: "c_000 bg_f3d",
                width: "2.75%",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: '当期与同期浆量差/袋',
                field: 'collNumDiff',
                width: "2.75%",
                class: "c_000 bg_f3d",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                field: 'currentTimeAddPNum',
                width: "2.75%",
                title: '当期新增人数',
                class: "c_000 bg_d9e",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                field: 'lastTimeAddPNum',
                class: "c_000 bg_d9e",
                width: "2.6%",
                title: '同期新增人数',
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "新增浆员当期与同期差/袋",
                class: "c_000 bg_d9e",
                width: "2.6%",
                field: "addNumDiff",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                field: 'currentTimeAddCollNum',
                width: "2.6%",
                class: "c_000 bg_d9e",
                title: '当期新增浆量/袋',
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "同期新增浆量/袋",
                class: "c_000 bg_d9e",
                width: "2.6%",
                field: "lastTimeAddCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "忠诚浆员当期总人数",
                class: "c_000 bg_d1c",
                width: "2.6%",
                field: "currentTimeZCPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "忠诚浆员同期总人数",
                class: "c_000 bg_d1c",
                width: "2.6%",
                field: "lastTimeZCPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "忠诚浆员当期浆量/袋",
                class: "c_000 bg_d1c",
                width: "2.6%",
                field: "currentTimeZCCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "忠诚浆员同期浆量/袋",
                class: "c_000 bg_d1c",
                width: "2.6%",
                field: "lastTimeZCCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "忠诚浆员浆量当期与同期差/袋",
                class: "c_000 bg_d1c",
                width: "2.6%",
                field: "zcCollNumDiff",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "忠诚浆员去年浆量/袋",
                class: "c_000 bg_d1c",
                width: "2.6%",
                field: "lastYearZCCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "当期复苏浆员总人数",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "currentTimeFuSuPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "同期复苏浆员总人数",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "lastTimeFuSuNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "当期复苏浆员浆量/袋",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "currentTimeFuSuCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "同期复苏浆员浆量/袋",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "lastTimeFuSuCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "当期未进站总人数",
                class: "c_000 bg_f9c",
                width: "2.6%",
                field: "currentTimeNotComedPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "当期未进站总人数去年浆量/袋",
                class: "c_000 bg_f9c",
                width: "2.6%",
                field: "currentTimeNotComedPLastYearCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "休眠浆员总人数",
                class: "c_000 bg_d9e",
                width: "2.6%",
                field: "xiuMianPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "休眠浆员去年浆量/袋",
                class: "c_000 bg_d9e",
                width: "2.6%",
                field: "lastYearXiuMianCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "休眠浆员同期浆量/袋",
                class: "c_000 bg_d9e",
                width: "2.6%",
                field: "lastTimeXiuMianCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "流失浆员总人数",
                class: "c_000 bg_d1c",
                width: "2.6%",
                field: "liuShiPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "进站未链接浆员",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "comedNotConnPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "进站未链接浆员当期浆量/袋",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "comedNotConnThisTimeCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "进站未链接浆员同期浆量/袋",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "comedNotConnLastTimeCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "进站未链接浆员去年浆量/袋",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "comedNotConnLastYearCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "已链接休眠的浆员人数",
                class: "c_000 bg_d9e",
                width: "2.6%",
                field: "connXMPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "已链接休眠的浆员同期浆量/袋",
                class: "c_000 bg_d9e",
                width: "2.6%",
                field: "lastTimeConnXMCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "未链接休眠的浆员人数",
                class: "c_000 bg_d1c",
                width: "2.6%",
                field: "notConnXMPNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "未链接休眠的浆员同期浆量/袋",
                class: "c_000 bg_d1c",
                width: "2.6%",
                field: "lastTimeNotConnXMCollNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "义工总人数",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "volunteerNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }
            },
            {
                title: "义工管理浆员总人数",
                class: "c_000 bg_f3d",
                width: "2.6%",
                field: "volunConnGJZNum",
                formatter: function (value, row, index) {
                    return value === 0 ? "" : value
                }

            }
        ]
    });

    //bottom table
    $("#table").bootstrapTable('destroy').bootstrapTable({
        cache: false,
        data: roundTable.jylc,
        height: bodyclientH - 80 - $("#thisTown").height() - $("#coverTableSelect").height() - $(".show-title").height(),
        undefinedText: "",
        sortName: "times",
        pagination: true,
        paginationLoop: true,
        pageSize: 20,
        pageList: [10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 40, 50, "All"],
        paginationVAlign: "top",
        paginationHAlign: "left",
        search: true,
        onPostHeader: function () {
            //标记轮次
            getRoundAjax(function (item) {
                $("th[data-field=round" + item.thisRound + "]").css("background", "rgb(54, 142, 78)");
            });
        },
        onPostBody: function () {
            //添加class pulp-name-class
            $('.pulp-name-class').on('dblclick', function () {
                $(this).parents('tr').find(".pulp-name").addClass($(this).data("row"));
            }).trigger('dblclick');
            //manageNurse,生成护士下拉列表
            getNurseList(function (item) {
                var nurseHtml = "<option value=''>空</option>";
                for (var nur = 0; nur < item.length; nur++) {
                    nurseHtml += "<option value='" + item[nur].nurseId + "'>" + item[nur].nurseName + "</option>";
                }
                $("select[name=manageNurse]").html(nurseHtml);
                $('select[name="manageNurse"][value]').each(function () {
                    $(this).find('option[value="' + $(this).attr('value') + '"]').prop('selected', true);
                });
            });
            //importantPlup,生成重点浆员下拉列表
            getImportPulpData(function (item) {
                var importHtml = "<option value=''>空</option>";
                for (var i = 0; i < item.length; i++) {
                    importHtml += "<option value='" + item[i].code + "'>" + item[i].name + "</option>";
                }
                $("select[name=importantPlup]").html(importHtml);
                $('select[name="importantPlup"][value]').each(function () {
                    $(this).find('option[value="' + $(this).attr('value') + '"]').prop('selected', true);
                });
            });
        },
        columns: [
            {
                width: "2%",
                class: "",
                title: '序号',
                sortable: true,
                formatter: function (value, row, index) {
                    return index + 1;
                }
            },
            {
                field: "providerNo",
                title: '卡号',
                class: "",
                sortable: true,
                width: "4%",
                formatter: function (value, row, index) {
                    var html = "<div class='cursor' onmouseover='mouseoverToast(this, \"" + ("测试2018-12-15") + "\")' onmouseout='mouseoutToast(this)'><span>" + value + "</span><span onclick='openVolunteer(this,\"" + row.providerNo + "\")' class='placehold-communication cursor' ></span></div>";
                    return value;
                }
            },
            {
                field: 'name',
                width: "4%",
                class: "pulp-name",
                sortable: true,
                title: '姓名'
            },
            {
                field: "villId",
                class: "",
                width: "4%",
                sortable: true,
                title: '重点浆员类型',
                formatter: function (value, row, index) {
                    return "<div><select name='importantPlup' class='importPulp" + row.providerNo + "'  " + ( row.villId ? "value='" + row.villId + "'" : "" ) + "></select></div>";
                }
            },
            {
                field: 'age',
                class: "",
                sortable: true,
                width: "2%",
                title: '年龄'
            },
            {
                field: 'sex',
                title: '性别',
                sortable: true,
                class: "",
                width: "2%",
            },
            {
                field: 'pulpAge',
                width: "2%",
                class: "",
                sortable: true,
                title: '浆龄'
            },
            {
                field: 'currentTimePulps',
                width: "2%",
                sortable: true,
                title: '今年当期总次数',
                class: "bg_2f9"
            },
            {
                field: 'lastTimePulps',
                class: "bg_2f9",
                sortable: true,
                width: "3%",
                title: '去年同期总次数'
            },
            {
                field: 'lastYearPulps',
                sortable: true,
                width: "3%",
                class: "bg_2f9",
                title: '去年献浆总次数',
            },
            {
                title: "献浆总次数",
                sortable: true,
                class: "bg_2f9",
                width: "3%",
                field: "times",
            },
            {
                title: "献浆员类型",
                class: "",
                sortable: true,
                width: "3%",
                field: "gjzType"
            },
            {
                title: "管理护士姓名",
                class: "",
                sortable: true,
                width: "4%",
                field: "manageNurse",
                formatter: function (value, row, index) {
                    var html = "<div onmouseover='mouseoverToast(this,\"" + ("修改历史") + "\")' onmouseout='mouseoutToast(this)' ><select name='manageNurse' class='nurse" + row.providerNo + "'  " + ( row.manageNurseId ? "value='" + row.manageNurseId + "'" : "" ) + "></select><span onclick='openNurseHistory(\"" + row.providerNo + "\")' class='placehold-communication cursor' ></span></div>";
                    return html;
                }
            },
            {
                title: "管理义工姓名",
                class: "round-volunteer",
                width: "4%",
                sortable: true,
                field: "yiGong",
                formatter: function (value, row, index) {
                    var html = "<div class='cursor' onmouseover='mouseoverToast(this,\"" + ("修改义工") + "\")' onmouseout='mouseoutToast(this)'><span data-yigongid='" + (row.yiGongId ? row.yiGongId : "") + "'>" + (row.yiGong ? row.yiGong : "") + "</span><span onclick='openVolunteer(this,\"" + row.providerNo + "\")' class='placehold-communication cursor' ></span></div>";
                    return html;
                }
            },
            {
                title: "介绍人姓名",
                class: "",
                width: "4%",
                sortable: true,
                field: "jsr"
            },
            {
                title: "分组编号",
                class: "",
                width: "2%",
                sortable: true,
                field: "jbGroup"
            },
            {
                title: "最新沟通内容",
                class: "",
                width: "5%",
                sortable: true,
                field: "communResult",
                formatter: function (value, row, index) {
                    var html = "<div " + (value ? "onmouseover='mouseoverToast(this,\"" + value + "\")'" : "") + "  onmouseout='mouseoutToast(this)'><span class='cursor' onclick='" + ( row.communResult ? "openNotPulpCommunication(\"" + row.providerNo + "\")" : "") + "' style='width: 100%;display: inline-block;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;'>" + ( value ? value : "" ) + "</span><span class='placehold-communication'></span></div>";
                    return html;
                }
            },
            {
                title: "详细地址",
                class: "",
                width: "8%",
                sortable: true,
                field: "address"
            },
            {
                title: "1",
                class: "roundID",
                field: "round1",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound1, row.round1);
                }
            },
            {
                title: "2",
                class: "roundID",
                sortable: true,
                field: "round2",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound2, row.round2);
                }
            },
            {
                title: "3",
                class: "roundID",
                sortable: true,
                field: "round3",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound3, row.round3);
                }
            },
            {
                title: "4",
                class: "roundID",
                sortable: true,
                field: "round4",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound4, row.round4);
                }
            },
            {
                title: "5",
                class: "roundID",
                sortable: true,
                field: "round5",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound5, row.round5);
                }
            },
            {
                title: "6",
                class: "roundID",
                field: "round6",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound6, row.round6);
                }
            },
            {
                title: "7",
                class: "roundID",
                field: "round7",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound7, row.round7);
                }
            },
            {
                title: "8",
                class: "roundID",
                field: "round8",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound8, row.round8);
                }
            },
            {
                title: "9",
                class: "roundID",
                field: "round9",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound9, row.round9);
                }
            },
            {
                title: "10",
                class: "roundID",
                field: "round10",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound10, row.round10);
                }
            },
            {
                title: "11",
                class: "roundID",
                sortable: true,
                field: "round11",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound11, row.round11);
                }
            },
            {
                title: "12",
                class: "roundID",
                sortable: true,
                field: "round12",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound12, row.round12);
                }
            },
            {
                title: "13",
                class: "roundID",
                field: "round13",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound13, row.round13);
                }
            },
            {
                title: "14",
                class: "roundID",
                sortable: true,
                field: "round14",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound14, row.round14);
                }
            },
            {
                title: "15",
                class: "roundID",
                field: "round15",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound15, row.round15);
                }
            },
            {
                title: "16",
                class: "roundID",
                field: "round16",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound16, row.round16);
                }
            },
            {
                title: "17",
                class: "roundID",
                field: "round17",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound17, row.round17);
                }
            },
            {
                title: "18",
                class: "roundID",
                sortable: true,
                field: "round18",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound18, row.round18);
                }

            },
            {
                title: "19",
                class: "roundID",
                field: "round19",
                sortable: true,
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound19, row.round19);
                }

            },
            {
                title: "20",
                class: "roundID",
                sortable: true,
                field: "round20",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound20, row.round20);
                }

            },
            {
                title: "21",
                class: "roundID",
                sortable: true,
                field: "round21",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound21, row.round21);
                }
            },
            {
                title: "22",
                class: "roundID",
                sortable: true,
                field: "round22",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound22, row.round22);
                }
            },
            {
                title: "23",
                class: "roundID",
                sortable: true,
                field: "round23",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound23, row.round23);
                }

            },
            {
                title: "24",
                class: "roundID",
                sortable: true,
                field: "round24",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound24, row.round24);
                }

            },
            {
                title: "25",
                class: "roundID",
                sortable: true,
                field: "round25",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound25, row.round25);
                }

            },
            {
                title: "26",
                class: "roundID",
                sortable: true,
                field: "round26",
                formatter: function (value, row, index) {
                    return getRoundEle(value, row, index, row.lastRound26, row.round26);
                }

            }
        ]
    });
    //hidePlaceholder
    placeholder.hide(document.body);
    $(".vii-holder-mask").hide();
}

/*
 * coverTable
 * 表格提交
 * */
$("#coverTable .submit-table").on("click", function () {
    var selected = [];
    $("#table select[name=manageNurse]").each(function () {
        selected.push({
            providerNo: $(this).attr("class").substr(5),
            nurseId: $(this).val(),
            villId: $(this).parents("tr").find("select[name=importantPlup]").val()
        })
    });
    setManageNurse(selected, function (item) {
        getTableData($("#coverTableSelect").val(), $("#coverTableType").val(), $("#coverTablevillage").val(), function (item) {
            initTable(getDefaultValue(), item);
        });
    });
});


/*
* window.onresize
* 窗口大小改变时，对话框始终居中
* */
window.onresize = function () {
    autoCenter($("#popup"));
    autoCenter($("#popup1"));
};












